/**
 * author:Administrator
 * date:2016/2/26
 * desc: 消费者 query 接口
 */

"use strict";

let query = require('../infrastructure/query');

class CustomerQueryService {

  /**
   * 查询用户的ticket
   * @param customerId
   */
  * customerTicket(customerId) {
    return yield query.ticket.findByCustomer(customerId);
  }

  * customerOrder(customerId) {
    return yield query.order.findByCustomer(customerId);
  }


  * customerOrderDetail(customerId, orderId) {
    return yield query.order.customerOrderDetail(customerId, orderId);
  }

  // 允许 locId 为空
  * customerWare(cateId, locId, pageIndex, pageSize) {
    return yield query.ware.findByCustomer(cateId, locId, pageIndex, pageSize);
  }

  * customerCoupon(customerId, pageIndex, pageSize) {
    return yield query.coupon.findByCustomer(customerId, pageIndex, pageSize);
  }
}
module.exports = new CustomerQueryService();